'''
!pip install -U openai-whisper -q  # https://github.com/openai/whisper
!pip install gradio -q             # https://gradio.app/quickstart/
!pip install openai -q             # https://github.com/openai/openai-python
!pip install TTS -q                # https://github.com/coqui-ai/TTS
!pip install python-dotenv -q
'''
#

# tts 转换
# import whisper
# import gradio as gr
# import openai
# from TTS.api import TTS
#
# openai.api_key = 'sk-9Z52CKqCmyNaT1f6ibIPT3BlbkFJMrbxxxxx'
#
#
# tts = TTS('tts_models/zh-CN/baker/tacotron2-DDC-GST')
# # lst = tts.list_models()
# tts.tts_to_file(text="潘哥过十分钟内到", file_path="output.wav")

#
from openai import OpenAI
client = OpenAI(api_key="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")

audio_file= open("output.wav", "rb")
transcript = client.audio.transcriptions.create(
  model="whisper-1",
  file=audio_file
)

print(transcript)

